var rootPath = getRootPath();	

var packageData = {
};
var packagePkData = {
};
var flag1 = false;
var flag2 = false;
var flag3 = false;
$(document).ready(function(){
	windowSizeChange_packageExhiPk();
	
	var packageCode = getQueryParamValue("packageCode");
	
	loadPackageData(packageCode,'default');
	
	$("input[name='packageExhibitionCompare']").click(function(){
		comparePackageInfo();
	});
	

	
    //选择品牌车系
    $(".selectBrandSeries").click(function(){
   	 
        var seriesCode = $("#defaultSeriesCode").val();
        
        //判断是否已经已有已选择的车系，车型，配置,如果存在直接进入车型配置选择页面，否则 进入品牌车系选择界面 
    	 if(seriesCode ==undefined || seriesCode==''){
    		 initBrandSeries('default');
        }else{
       	 initModelPackage(seriesCode,'default');
        }
        
    });
    
    //选择PK品牌车系
    $(".selectBrandSeriesPk").click(function(){
      	 
        var seriesCode = $("#defaultSeriesCode").val();
        
        //判断是否已经已有已选择的车系，车型，配置,如果存在直接进入车型配置选择页面，否则 进入品牌车系选择界面 
    	 if(seriesCode ==undefined || seriesCode==''){
    		 initBrandSeries('pk');
        }else{
       	   initModelPackage(seriesCode,'pk');
        }
    	 
    });
    
    
    //从新选择品牌车系
    $(".againSelectBrandSeries").click(function(){
		 initBrandSeries();
    });

	
});


//对比配置信息
function comparePackageInfo(){
	
	flag1 = false;
	flag2 = false;
	flag3 = false;
	
	$("input[name='packageExhibitionCompare']").each(function(){
		if($(this).is(":checked")){
			var tmpVal = $(this).val();
			if(tmpVal==1){
				flag1 = true;
			}else if(tmpVal==2){
				flag2 = true;
			}else if(tmpVal==3){
				flag3 = true;
			}
		}
	});
	
	var packageCode = $("#packageCode").val();
	var packageCodePk = $("#packageCodePk").val();

	
	if(packageCode !=undefined && packageCode !='' && packageCodePk !=undefined && packageCodePk !=''){
		//隐藏相同项
		if(flag1==true){
			hideTheSame("hide");
		}else{
			hideTheSame("show");
		}
		//标示差异项
		if(flag2==true){
			identifyDifferences("add");
		}else{
			identifyDifferences("remove");
		}
		//隐藏无内容项
		if(flag3==true){
			hideNoContent("hide");
		}else{
			hideNoContent("show");
		}
		
		//相关一级标题的隐藏
		relateTitleHide();
	}


}

//隐藏一级标题字段
function relateTitleHide(){
	//基本参数
	if(!($("#vehicleModel").is(":hidden"))
			|| !($("#standardGear").is(":hidden"))
			|| !($("#lengthWidthHeight").is(":hidden"))
			|| !($("#engine").is(":hidden"))
			|| !($("#gearbox").is(":hidden"))
			|| !($("#bodyStructure").is(":hidden"))
			|| !($("#lwh").is(":hidden"))
			|| !($("#miitFuelConsum").is(":hidden"))){
		$("#basicParameter").show();
	}else{
		$("#basicParameter").hide();
	}
	
	//车身
	if(!($("#length").is(":hidden"))
			|| !($("#width").is(":hidden"))
			|| !($("#height").is(":hidden"))
			|| !($("#wheelBase").is(":hidden"))
			|| !($("#fwTrack").is(":hidden"))
			|| !($("#rwTrack").is(":hidden"))
			|| !($("#curbWeight").is(":hidden"))
			|| !($("#cargoVolume").is(":hidden"))){
		$("#carBody").show();
	}else{
		$("#carBody").show();
	}
	
	//发动机
	if(!($("#engineModel").is(":hidden"))
			|| !($("#displacement").is(":hidden"))
			|| !($("#cylinderVolume").is(":hidden"))
			|| !($("#airIntakeForm").is(":hidden"))
			|| !($("#cylinderArran").is(":hidden"))
			|| !($("#cylinderNum").is(":hidden"))
			|| !($("#cylinderNumPer").is(":hidden"))
			|| !($("#reductionRatio").is(":hidden"))
			|| !($("#maxHorsepower").is(":hidden"))
			|| !($("#maxPower").is(":hidden"))
			|| !($("#maxPowerSpeed").is(":hidden"))
			|| !($("#maxTorque").is(":hidden"))
			|| !($("#maxTorqueSpeed").is(":hidden"))
			|| !($("#fuelType").is(":hidden"))
			|| !($("#fuelLabel").is(":hidden"))
			|| !($("#oilSupplyWay").is(":hidden"))
			|| !($("#fueltankVolume").is(":hidden"))){
		$("#engineTitle").show();
	}else{
		$("#engineTitle").hide();
	}

	

	//变速箱
	if(!($("#gearNum").is(":hidden"))
			|| !($("#gearboxType").is(":hidden"))){
		$("#speedChangingBox").show();
	}else{
		$("#speedChangingBox").hide();
	}
	
	//底盘转向
	if(!($("#driveWay").is(":hidden"))
			|| !($("#frontSusType").is(":hidden"))
			|| !($("#rearSusType").is(":hidden"))
			|| !($("#powerType").is(":hidden"))){
		$("#chassisSteering").show();
	}else{
		$("#chassisSteering").hide();
	}
	
	
	//车轮制动
	if(!($("#faType").is(":hidden"))
			|| !($("#raType").is(":hidden"))
			|| !($("#ftSize").is(":hidden"))
			|| !($("#rtSize").is(":hidden"))
			|| !($("#spareTireSize").is(":hidden"))
			|| !($("#wheelHubMaterial").is(":hidden"))){
		$("#wheelBrakeTitle").show();
	}else{
		$("#wheelBrakeTitle").hide();
	}
	
	//安全配置
	if(!($("#drivingAirbag").is(":hidden"))
			|| !($("#copilotAirbag").is(":hidden"))
			|| !($("#fsAirbag").is(":hidden"))
			|| !($("#fhAirbag").is(":hidden"))
			|| !($("#kneeAirbag").is(":hidden"))
			|| !($("#rsAirbag").is(":hidden"))
			|| !($("#rhAirbag").is(":hidden"))
			|| !($("#saBeltPrompt").is(":hidden"))
			|| !($("#tirePmDevices").is(":hidden"))
			|| !($("#zeroPressureLc").is(":hidden"))
			|| !($("#cenLock").is(":hidden"))
			|| !($("#csLock").is(":hidden"))
			|| !($("#teleKey").is(":hidden"))
			|| !($("#keylessSs").is(":hidden"))
			|| !($("#engineElecGuard").is(":hidden"))){
		$("#securityConfiguration").show();
	}else{
		$("#securityConfiguration").hide();
	}
	
	//行车辅助 
	if(!($("#absAntiLock").is(":hidden"))
			|| !($("#brakeForceDisb").is(":hidden"))
			|| !($("#brakeAssist").is(":hidden"))
			|| !($("#tractionControl").is(":hidden"))
			|| !($("#stabilityControl").is(":hidden"))
			|| !($("#assistParking").is(":hidden"))
			|| !($("#slopeSlowDescent").is(":hidden"))
			|| !($("#varSusp").is(":hidden"))
			|| !($("#airSusp").is(":hidden"))
			|| !($("#varSteerRatio").is(":hidden"))
			|| !($("#autoPi").is(":hidden"))
			|| !($("#autoCruise").is(":hidden"))
			|| !($("#cruiseControl").is(":hidden"))
			|| !($("#doublingAuxiliary").is(":hidden"))
			|| !($("#initiativeBrake").is(":hidden"))
			|| !($("#activeSteerSystem").is(":hidden"))){
		$("#drivingAuxiliary").show();
	}else{
		$("#drivingAuxiliary").hide();
	}
	
	//外部配置 
	if(!($("#powerSunroof").is(":hidden"))
			|| !($("#panoramicSunroof").is(":hidden"))
			|| !($("#motionAppearSuite").is(":hidden"))
			|| !($("#elecSuctionDoor").is(":hidden"))){
		$("#externalConfiguration").show();

	}else{
		$("#externalConfiguration").hide();

	}
	
	//内部配置 
	if(!($("#leatherSw").is(":hidden"))
			|| !($("#swAdjust").is(":hidden"))
			|| !($("#swElecAdjust").is(":hidden"))
			|| !($("#multiFunSw").is(":hidden"))
			|| !($("#swShift").is(":hidden"))
			|| !($("#reverRadar").is(":hidden"))
			|| !($("#reverVideoImages").is(":hidden"))
			|| !($("#drivingScreen").is(":hidden"))
			|| !($("#hudDigisplay").is(":hidden"))
			|| !($("#gps").is(":hidden"))
			|| !($("#locInterServices").is(":hidden"))
			|| !($("#nvSystem").is(":hidden"))
			|| !($("#controlLcdDisplay").is(":hidden"))
			|| !($("#panoramicCamera").is(":hidden"))
			|| !($("#ccScreen").is(":hidden"))
			|| !($("#catTv").is(":hidden"))
			|| !($("#rearLcd").is(":hidden"))
			|| !($("#multimediaSystem").is(":hidden"))
			|| !($("#speakersNum").is(":hidden"))){
		$("#innerConfiguration").show();
	}else{
		$("#innerConfiguration").hide();
	}
	
	//座椅配置 
	if(!($("#seatMateria").is(":hidden"))
			|| !($("#movementStyleSeats").is(":hidden"))
			|| !($("#seatHeightAdjust").is(":hidden"))
			|| !($("#lsAdjust").is(":hidden"))
			|| !($("#ssAdjust").is(":hidden"))
			|| !($("#driversElecAdjust").is(":hidden"))
			|| !($("#srAngleAdjust").is(":hidden"))
			|| !($("#srSeatMove").is(":hidden"))
			|| !($("#rsElecAdjust").is(":hidden"))
			|| !($("#elecChairMemory").is(":hidden"))
			|| !($("#frSeatHeating").is(":hidden"))
			|| !($("#rsVentilation").is(":hidden"))
			|| !($("#massageSeat").is(":hidden"))
			|| !($("#trSeats").is(":hidden"))
			|| !($("#rsWayDown").is(":hidden"))
			|| !($("#frCentralArmrest").is(":hidden"))
			|| !($("#rearCupHolder").is(":hidden"))){
		$("#seatConfiguration").show();
	}else{
		$("#seatConfiguration").hide();
	}
	
	//多媒体配置
	if(!($("#bcPhone").is(":hidden"))
			|| !($("#extAudioInterface").is(":hidden"))
			|| !($("#audioSupportMp3").is(":hidden"))){
		$("#multimediaConfiguration").show();
	}else{
		$("#multimediaConfiguration").hide();
	}

	
	//灯光配置  
	if(!($("#headlight").is(":hidden"))
			|| !($("#drLamps").is(":hidden"))
			|| !($("#autoHeadlights").is(":hidden"))
			|| !($("#shLamp").is(":hidden"))
			|| !($("#frontFogLamp").is(":hidden"))
			|| !($("#hhAdjust").is(":hidden"))
			|| !($("#hcDevice").is(":hidden"))
			|| !($("#atmoCarLights").is(":hidden"))){
		$("#lightConfiguration").show();
	}else{
		$("#lightConfiguration").hide();
	}
	
	//玻璃/后视镜
	if(!($("#frElecWins").is(":hidden"))
			|| !($("#winClipHandFun").is(":hidden"))
			|| !($("#heatProtectGlass").is(":hidden"))
			|| !($("#rmElecRegulation").is(":hidden"))
			|| !($("#rmHeating").is(":hidden"))
			|| !($("#rmAntiGlare").is(":hidden"))
			|| !($("#rmElecFolding").is(":hidden"))
			|| !($("#rmMemory").is(":hidden"))
			|| !($("#rearWs").is(":hidden"))
			|| !($("#rearsideWs").is(":hidden"))
			|| !($("#vcMirror").is(":hidden"))
			|| !($("#rearWiper").is(":hidden"))){
		$("#glassMirrorTitle").show();
	}else{
		$("#glassMirrorTitle").hide();
	}
	
	//空调/冰箱
	if(!($("#acControlMode").is(":hidden"))
		|| !($("#rearIndeAc").is(":hidden"))
		|| !($("#rearDiffuser").is(":hidden"))
		|| !($("#tpZoneControl").is(":hidden"))
		|| !($("#carAirCondi").is(":hidden"))
		|| !($("#carRefrigerator").is(":hidden"))){
		
		$("#airConditioningRefrigerator").show();
	}else{
		$("#airConditioningRefrigerator").hide();
	}
	
}


//隐藏相同项
function hideTheSame(typeWay){
	hideTheSameCommon(typeWay,"lengthWidthHeight");
	hideTheSameCommon(typeWay,"vehicleModel");
	hideTheSameCommon(typeWay,"standardGear");
	hideTheSameCommon(typeWay,"engine");
	hideTheSameCommon(typeWay,"gearbox");
	hideTheSameCommon(typeWay,"bodyStructure");
	hideTheSameCommon(typeWay,"miitFuelConsum");
	hideTheSameCommon(typeWay,"length");
	hideTheSameCommon(typeWay,"width");
	hideTheSameCommon(typeWay,"height");
	hideTheSameCommon(typeWay,"wheelBase");
	hideTheSameCommon(typeWay,"fwTrack");
	hideTheSameCommon(typeWay,"rwTrack");
	hideTheSameCommon(typeWay,"curbWeight");
	hideTheSameCommon(typeWay,"cargoVolume");
	hideTheSameCommon(typeWay,"engineModel");
	hideTheSameCommon(typeWay,"displacement");
	hideTheSameCommon(typeWay,"cylinderVolume");
	hideTheSameCommon(typeWay,"airIntakeForm");
	hideTheSameCommon(typeWay,"cylinderArran");
	hideTheSameCommon(typeWay,"cylinderNum");
	hideTheSameCommon(typeWay,"cylinderNumPer");
	hideTheSameCommon(typeWay,"reductionRatio");
	hideTheSameCommon(typeWay,"maxHorsepower");
	hideTheSameCommon(typeWay,"maxPower");
	hideTheSameCommon(typeWay,"maxPowerSpeed");
	hideTheSameCommon(typeWay,"maxTorque");
	hideTheSameCommon(typeWay,"maxTorqueSpeed");
	hideTheSameCommon(typeWay,"fuelType");
	hideTheSameCommon(typeWay,"fuelLabel");
	hideTheSameCommon(typeWay,"oilSupplyWay");
	hideTheSameCommon(typeWay,"fueltankVolume");
	hideTheSameCommon(typeWay,"gearNum");
	hideTheSameCommon(typeWay,"gearboxType");
	hideTheSameCommon(typeWay,"driveWay");
	hideTheSameCommon(typeWay,"frontSusType");
	hideTheSameCommon(typeWay,"rearSusType");
	hideTheSameCommon(typeWay,"powerType");
	hideTheSameCommon(typeWay,"faType");
	hideTheSameCommon(typeWay,"raType");
	hideTheSameCommon(typeWay,"ftSize");
	hideTheSameCommon(typeWay,"rtSize");
	hideTheSameCommon(typeWay,"spareTireSize");
	hideTheSameCommon(typeWay,"wheelHubMaterial");
	hideTheSameCommon(typeWay,"drivingAirbag");
	hideTheSameCommon(typeWay,"copilotAirbag");
	hideTheSameCommon(typeWay,"fsAirbag");
	hideTheSameCommon(typeWay,"fhAirbag");
	hideTheSameCommon(typeWay,"kneeAirbag");
	hideTheSameCommon(typeWay,"rsAirbag");
	hideTheSameCommon(typeWay,"rhAirbag");
	hideTheSameCommon(typeWay,"saBeltPrompt");
	hideTheSameCommon(typeWay,"tirePmDevices");
	hideTheSameCommon(typeWay,"zeroPressureLc");
	hideTheSameCommon(typeWay,"cenLock");
	hideTheSameCommon(typeWay,"csLock");
	hideTheSameCommon(typeWay,"teleKey");
	hideTheSameCommon(typeWay,"keylessSs");
	hideTheSameCommon(typeWay,"engineElecGuard");
	hideTheSameCommon(typeWay,"absAntiLock");
	hideTheSameCommon(typeWay,"brakeForceDisb");
	hideTheSameCommon(typeWay,"brakeAssist");
	hideTheSameCommon(typeWay,"tractionControl");
	hideTheSameCommon(typeWay,"stabilityControl");
	hideTheSameCommon(typeWay,"assistParking");
	hideTheSameCommon(typeWay,"slopeSlowDescent");
	hideTheSameCommon(typeWay,"varSusp");
	hideTheSameCommon(typeWay,"airSusp");
	hideTheSameCommon(typeWay,"varSteerRatio");
	hideTheSameCommon(typeWay,"autoPi");
	hideTheSameCommon(typeWay,"autoCruise");
	hideTheSameCommon(typeWay,"cruiseControl");
	hideTheSameCommon(typeWay,"doublingAuxiliary");
	hideTheSameCommon(typeWay,"initiativeBrake");
	hideTheSameCommon(typeWay,"activeSteerSystem");
	hideTheSameCommon(typeWay,"powerSunroof");
	hideTheSameCommon(typeWay,"panoramicSunroof");
	hideTheSameCommon(typeWay,"motionAppearSuite");
	hideTheSameCommon(typeWay,"elecSuctionDoor");
	hideTheSameCommon(typeWay,"leatherSw");
	hideTheSameCommon(typeWay,"swAdjust");
	hideTheSameCommon(typeWay,"swElecAdjust");
	hideTheSameCommon(typeWay,"multiFunSw");
	hideTheSameCommon(typeWay,"swShift");
	hideTheSameCommon(typeWay,"reverRadar");
	hideTheSameCommon(typeWay,"reverVideoImages");
	hideTheSameCommon(typeWay,"drivingScreen");
	hideTheSameCommon(typeWay,"hudDigisplay");
	hideTheSameCommon(typeWay,"gps");
	hideTheSameCommon(typeWay,"locInterServices");
	hideTheSameCommon(typeWay,"nvSystem");
	hideTheSameCommon(typeWay,"controlLcdDisplay");
	hideTheSameCommon(typeWay,"panoramicCamera");
	hideTheSameCommon(typeWay,"ccScreen");
	hideTheSameCommon(typeWay,"catTv");
	hideTheSameCommon(typeWay,"rearLcd");
	hideTheSameCommon(typeWay,"multimediaSystem");
	hideTheSameCommon(typeWay,"speakersNum");
	hideTheSameCommon(typeWay,"seatMateria");
	hideTheSameCommon(typeWay,"movementStyleSeats");
	hideTheSameCommon(typeWay,"seatHeightAdjust");
	hideTheSameCommon(typeWay,"lsAdjust");
	hideTheSameCommon(typeWay,"ssAdjust");
	hideTheSameCommon(typeWay,"driversElecAdjust");
	hideTheSameCommon(typeWay,"srAngleAdjust");
	hideTheSameCommon(typeWay,"srSeatMove");
	hideTheSameCommon(typeWay,"rsElecAdjust");
	hideTheSameCommon(typeWay,"elecChairMemory");
	hideTheSameCommon(typeWay,"frSeatHeating");
	hideTheSameCommon(typeWay,"rsVentilation");
	hideTheSameCommon(typeWay,"massageSeat");
	hideTheSameCommon(typeWay,"trSeats");
	hideTheSameCommon(typeWay,"rsWayDown");
	hideTheSameCommon(typeWay,"frCentralArmrest");
	hideTheSameCommon(typeWay,"rearCupHolder");
	hideTheSameCommon(typeWay,"bcPhone");
	hideTheSameCommon(typeWay,"extAudioInterface");
	hideTheSameCommon(typeWay,"audioSupportMp3");
	hideTheSameCommon(typeWay,"headlight");
	hideTheSameCommon(typeWay,"drLamps");
	hideTheSameCommon(typeWay,"autoHeadlights");
	hideTheSameCommon(typeWay,"shLamp");
	hideTheSameCommon(typeWay,"frontFogLamp");
	hideTheSameCommon(typeWay,"hhAdjust");
	hideTheSameCommon(typeWay,"hcDevice");
	hideTheSameCommon(typeWay,"atmoCarLights");
	hideTheSameCommon(typeWay,"frElecWins");
	hideTheSameCommon(typeWay,"winClipHandFun");
	hideTheSameCommon(typeWay,"heatProtectGlass");
	hideTheSameCommon(typeWay,"rmElecRegulation");
	hideTheSameCommon(typeWay,"rmHeating");
	hideTheSameCommon(typeWay,"rmAntiGlare");
	hideTheSameCommon(typeWay,"rmElecFolding");
	hideTheSameCommon(typeWay,"rmMemory");
	hideTheSameCommon(typeWay,"rearWs");
	hideTheSameCommon(typeWay,"rearsideWs");
	hideTheSameCommon(typeWay,"vcMirror");
	hideTheSameCommon(typeWay,"rearWiper");
	hideTheSameCommon(typeWay,"sensingWiper");
	hideTheSameCommon(typeWay,"acControlMode");
	hideTheSameCommon(typeWay,"rearIndeAc");
	hideTheSameCommon(typeWay,"rearDiffuser");
	hideTheSameCommon(typeWay,"tpZoneControl");
	hideTheSameCommon(typeWay,"carAirCondi");
	hideTheSameCommon(typeWay,"carRefrigerator");
}

//隐藏相同项-common
function hideTheSameCommon(typeWay,columnName){
	if(typeWay=='hide'){
		if(packageData[""+columnName+""]!=undefined && packageData[""+columnName+""]!=''
			&& packagePkData[""+columnName+""]!=undefined && packagePkData[""+columnName+""]!=''
				&& packageData[""+columnName+""]==packagePkData[""+columnName+""]){
		    $("#"+columnName+"").parent().hide();
		}else{
		    $("#"+columnName+"").parent().show();
		}
	}else if(typeWay=='show'){
	    $("#"+columnName+"").parent().show();
	}
}

//标示差异项
function identifyDifferences(typeWay){
	identifyDifferencesCommon(typeWay,"lengthWidthHeight");
	identifyDifferencesCommon(typeWay,"vehicleModel");
	identifyDifferencesCommon(typeWay,"standardGear");
	identifyDifferencesCommon(typeWay,"engine");
	identifyDifferencesCommon(typeWay,"gearbox");
	identifyDifferencesCommon(typeWay,"bodyStructure");
	identifyDifferencesCommon(typeWay,"miitFuelConsum");
	identifyDifferencesCommon(typeWay,"length");
	identifyDifferencesCommon(typeWay,"width");
	identifyDifferencesCommon(typeWay,"height");
	identifyDifferencesCommon(typeWay,"wheelBase");
	identifyDifferencesCommon(typeWay,"fwTrack");
	identifyDifferencesCommon(typeWay,"rwTrack");
	identifyDifferencesCommon(typeWay,"curbWeight");
	identifyDifferencesCommon(typeWay,"cargoVolume");
	identifyDifferencesCommon(typeWay,"engineModel");
	identifyDifferencesCommon(typeWay,"displacement");
	identifyDifferencesCommon(typeWay,"cylinderVolume");
	identifyDifferencesCommon(typeWay,"airIntakeForm");
	identifyDifferencesCommon(typeWay,"cylinderArran");
	identifyDifferencesCommon(typeWay,"cylinderNum");
	identifyDifferencesCommon(typeWay,"cylinderNumPer");
	identifyDifferencesCommon(typeWay,"reductionRatio");
	identifyDifferencesCommon(typeWay,"maxHorsepower");
	identifyDifferencesCommon(typeWay,"maxPower");
	identifyDifferencesCommon(typeWay,"maxPowerSpeed");
	identifyDifferencesCommon(typeWay,"maxTorque");
	identifyDifferencesCommon(typeWay,"maxTorqueSpeed");
	identifyDifferencesCommon(typeWay,"fuelType");
	identifyDifferencesCommon(typeWay,"fuelLabel");
	identifyDifferencesCommon(typeWay,"oilSupplyWay");
	identifyDifferencesCommon(typeWay,"fueltankVolume");
	identifyDifferencesCommon(typeWay,"gearNum");
	identifyDifferencesCommon(typeWay,"gearboxType");
	identifyDifferencesCommon(typeWay,"driveWay");
	identifyDifferencesCommon(typeWay,"frontSusType");
	identifyDifferencesCommon(typeWay,"rearSusType");
	identifyDifferencesCommon(typeWay,"powerType");
	identifyDifferencesCommon(typeWay,"faType");
	identifyDifferencesCommon(typeWay,"raType");
	identifyDifferencesCommon(typeWay,"ftSize");
	identifyDifferencesCommon(typeWay,"rtSize");
	identifyDifferencesCommon(typeWay,"spareTireSize");
	identifyDifferencesCommon(typeWay,"wheelHubMaterial");
	identifyDifferencesCommon(typeWay,"drivingAirbag");
	identifyDifferencesCommon(typeWay,"copilotAirbag");
	identifyDifferencesCommon(typeWay,"fsAirbag");
	identifyDifferencesCommon(typeWay,"fhAirbag");
	identifyDifferencesCommon(typeWay,"kneeAirbag");
	identifyDifferencesCommon(typeWay,"rsAirbag");
	identifyDifferencesCommon(typeWay,"rhAirbag");
	identifyDifferencesCommon(typeWay,"saBeltPrompt");
	identifyDifferencesCommon(typeWay,"tirePmDevices");
	identifyDifferencesCommon(typeWay,"zeroPressureLc");
	identifyDifferencesCommon(typeWay,"cenLock");
	identifyDifferencesCommon(typeWay,"csLock");
	identifyDifferencesCommon(typeWay,"teleKey");
	identifyDifferencesCommon(typeWay,"keylessSs");
	identifyDifferencesCommon(typeWay,"engineElecGuard");
	identifyDifferencesCommon(typeWay,"absAntiLock");
	identifyDifferencesCommon(typeWay,"brakeForceDisb");
	identifyDifferencesCommon(typeWay,"brakeAssist");
	identifyDifferencesCommon(typeWay,"tractionControl");
	identifyDifferencesCommon(typeWay,"stabilityControl");
	identifyDifferencesCommon(typeWay,"assistParking");
	identifyDifferencesCommon(typeWay,"slopeSlowDescent");
	identifyDifferencesCommon(typeWay,"varSusp");
	identifyDifferencesCommon(typeWay,"airSusp");
	identifyDifferencesCommon(typeWay,"varSteerRatio");
	identifyDifferencesCommon(typeWay,"autoPi");
	identifyDifferencesCommon(typeWay,"autoCruise");
	identifyDifferencesCommon(typeWay,"cruiseControl");
	identifyDifferencesCommon(typeWay,"doublingAuxiliary");
	identifyDifferencesCommon(typeWay,"initiativeBrake");
	identifyDifferencesCommon(typeWay,"activeSteerSystem");
	identifyDifferencesCommon(typeWay,"powerSunroof");
	identifyDifferencesCommon(typeWay,"panoramicSunroof");
	identifyDifferencesCommon(typeWay,"motionAppearSuite");
	identifyDifferencesCommon(typeWay,"elecSuctionDoor");
	identifyDifferencesCommon(typeWay,"leatherSw");
	identifyDifferencesCommon(typeWay,"swAdjust");
	identifyDifferencesCommon(typeWay,"swElecAdjust");
	identifyDifferencesCommon(typeWay,"multiFunSw");
	identifyDifferencesCommon(typeWay,"swShift");
	identifyDifferencesCommon(typeWay,"reverRadar");
	identifyDifferencesCommon(typeWay,"reverVideoImages");
	identifyDifferencesCommon(typeWay,"drivingScreen");
	identifyDifferencesCommon(typeWay,"hudDigisplay");
	identifyDifferencesCommon(typeWay,"gps");
	identifyDifferencesCommon(typeWay,"locInterServices");
	identifyDifferencesCommon(typeWay,"nvSystem");
	identifyDifferencesCommon(typeWay,"controlLcdDisplay");
	identifyDifferencesCommon(typeWay,"panoramicCamera");
	identifyDifferencesCommon(typeWay,"ccScreen");
	identifyDifferencesCommon(typeWay,"catTv");
	identifyDifferencesCommon(typeWay,"rearLcd");
	identifyDifferencesCommon(typeWay,"multimediaSystem");
	identifyDifferencesCommon(typeWay,"speakersNum");
	identifyDifferencesCommon(typeWay,"seatMateria");
	identifyDifferencesCommon(typeWay,"movementStyleSeats");
	identifyDifferencesCommon(typeWay,"seatHeightAdjust");
	identifyDifferencesCommon(typeWay,"lsAdjust");
	identifyDifferencesCommon(typeWay,"ssAdjust");
	identifyDifferencesCommon(typeWay,"driversElecAdjust");
	identifyDifferencesCommon(typeWay,"srAngleAdjust");
	identifyDifferencesCommon(typeWay,"srSeatMove");
	identifyDifferencesCommon(typeWay,"rsElecAdjust");
	identifyDifferencesCommon(typeWay,"elecChairMemory");
	identifyDifferencesCommon(typeWay,"frSeatHeating");
	identifyDifferencesCommon(typeWay,"rsVentilation");
	identifyDifferencesCommon(typeWay,"massageSeat");
	identifyDifferencesCommon(typeWay,"trSeats");
	identifyDifferencesCommon(typeWay,"rsWayDown");
	identifyDifferencesCommon(typeWay,"frCentralArmrest");
	identifyDifferencesCommon(typeWay,"rearCupHolder");
	identifyDifferencesCommon(typeWay,"bcPhone");
	identifyDifferencesCommon(typeWay,"extAudioInterface");
	identifyDifferencesCommon(typeWay,"audioSupportMp3");
	identifyDifferencesCommon(typeWay,"headlight");
	identifyDifferencesCommon(typeWay,"drLamps");
	identifyDifferencesCommon(typeWay,"autoHeadlights");
	identifyDifferencesCommon(typeWay,"shLamp");
	identifyDifferencesCommon(typeWay,"frontFogLamp");
	identifyDifferencesCommon(typeWay,"hhAdjust");
	identifyDifferencesCommon(typeWay,"hcDevice");
	identifyDifferencesCommon(typeWay,"atmoCarLights");
	identifyDifferencesCommon(typeWay,"frElecWins");
	identifyDifferencesCommon(typeWay,"winClipHandFun");
	identifyDifferencesCommon(typeWay,"heatProtectGlass");
	identifyDifferencesCommon(typeWay,"rmElecRegulation");
	identifyDifferencesCommon(typeWay,"rmHeating");
	identifyDifferencesCommon(typeWay,"rmAntiGlare");
	identifyDifferencesCommon(typeWay,"rmElecFolding");
	identifyDifferencesCommon(typeWay,"rmMemory");
	identifyDifferencesCommon(typeWay,"rearWs");
	identifyDifferencesCommon(typeWay,"rearsideWs");
	identifyDifferencesCommon(typeWay,"vcMirror");
	identifyDifferencesCommon(typeWay,"rearWiper");
	identifyDifferencesCommon(typeWay,"sensingWiper");
	identifyDifferencesCommon(typeWay,"acControlMode");
	identifyDifferencesCommon(typeWay,"rearIndeAc");
	identifyDifferencesCommon(typeWay,"rearDiffuser");
	identifyDifferencesCommon(typeWay,"tpZoneControl");
	identifyDifferencesCommon(typeWay,"carAirCondi");
	identifyDifferencesCommon(typeWay,"carRefrigerator");
}

//标示差异项-common
function identifyDifferencesCommon(typeWay,columnName){
	if(typeWay=='add'){
		if(packageData[""+columnName+""]!=packagePkData[""+columnName+""]){
		    $("#"+columnName+"").parent().addClass("success");
		}else{
		    $("#"+columnName+"").parent().removeClass("success");
		}
	}else if(typeWay=='remove'){
	    $("#"+columnName+"").parent().removeClass("success");
	}
}

//隐藏无内容项
function hideNoContent(typeWay){
	hideNoContentCommon(typeWay,"lengthWidthHeight");
	hideNoContentCommon(typeWay,"vehicleModel");
	hideNoContentCommon(typeWay,"standardGear");
	hideNoContentCommon(typeWay,"engine");
	hideNoContentCommon(typeWay,"gearbox");
	hideNoContentCommon(typeWay,"bodyStructure");
	hideNoContentCommon(typeWay,"miitFuelConsum");
	hideNoContentCommon(typeWay,"length");
	hideNoContentCommon(typeWay,"width");
	hideNoContentCommon(typeWay,"height");
	hideNoContentCommon(typeWay,"wheelBase");
	hideNoContentCommon(typeWay,"fwTrack");
	hideNoContentCommon(typeWay,"rwTrack");
	hideNoContentCommon(typeWay,"curbWeight");
	hideNoContentCommon(typeWay,"cargoVolume");
	hideNoContentCommon(typeWay,"engineModel");
	hideNoContentCommon(typeWay,"displacement");
	hideNoContentCommon(typeWay,"cylinderVolume");
	hideNoContentCommon(typeWay,"airIntakeForm");
	hideNoContentCommon(typeWay,"cylinderArran");
	hideNoContentCommon(typeWay,"cylinderNum");
	hideNoContentCommon(typeWay,"cylinderNumPer");
	hideNoContentCommon(typeWay,"reductionRatio");
	hideNoContentCommon(typeWay,"maxHorsepower");
	hideNoContentCommon(typeWay,"maxPower");
	hideNoContentCommon(typeWay,"maxPowerSpeed");
	hideNoContentCommon(typeWay,"maxTorque");
	hideNoContentCommon(typeWay,"maxTorqueSpeed");
	hideNoContentCommon(typeWay,"fuelType");
	hideNoContentCommon(typeWay,"fuelLabel");
	hideNoContentCommon(typeWay,"oilSupplyWay");
	hideNoContentCommon(typeWay,"fueltankVolume");
	hideNoContentCommon(typeWay,"gearNum");
	hideNoContentCommon(typeWay,"gearboxType");
	hideNoContentCommon(typeWay,"driveWay");
	hideNoContentCommon(typeWay,"frontSusType");
	hideNoContentCommon(typeWay,"rearSusType");
	hideNoContentCommon(typeWay,"powerType");
	hideNoContentCommon(typeWay,"faType");
	hideNoContentCommon(typeWay,"raType");
	hideNoContentCommon(typeWay,"ftSize");
	hideNoContentCommon(typeWay,"rtSize");
	hideNoContentCommon(typeWay,"spareTireSize");
	hideNoContentCommon(typeWay,"wheelHubMaterial");
	hideNoContentCommon(typeWay,"drivingAirbag");
	hideNoContentCommon(typeWay,"copilotAirbag");
	hideNoContentCommon(typeWay,"fsAirbag");
	hideNoContentCommon(typeWay,"fhAirbag");
	hideNoContentCommon(typeWay,"kneeAirbag");
	hideNoContentCommon(typeWay,"rsAirbag");
	hideNoContentCommon(typeWay,"rhAirbag");
	hideNoContentCommon(typeWay,"saBeltPrompt");
	hideNoContentCommon(typeWay,"tirePmDevices");
	hideNoContentCommon(typeWay,"zeroPressureLc");
	hideNoContentCommon(typeWay,"cenLock");
	hideNoContentCommon(typeWay,"csLock");
	hideNoContentCommon(typeWay,"teleKey");
	hideNoContentCommon(typeWay,"keylessSs");
	hideNoContentCommon(typeWay,"engineElecGuard");
	hideNoContentCommon(typeWay,"absAntiLock");
	hideNoContentCommon(typeWay,"brakeForceDisb");
	hideNoContentCommon(typeWay,"brakeAssist");
	hideNoContentCommon(typeWay,"tractionControl");
	hideNoContentCommon(typeWay,"stabilityControl");
	hideNoContentCommon(typeWay,"assistParking");
	hideNoContentCommon(typeWay,"slopeSlowDescent");
	hideNoContentCommon(typeWay,"varSusp");
	hideNoContentCommon(typeWay,"airSusp");
	hideNoContentCommon(typeWay,"varSteerRatio");
	hideNoContentCommon(typeWay,"autoPi");
	hideNoContentCommon(typeWay,"autoCruise");
	hideNoContentCommon(typeWay,"cruiseControl");
	hideNoContentCommon(typeWay,"doublingAuxiliary");
	hideNoContentCommon(typeWay,"initiativeBrake");
	hideNoContentCommon(typeWay,"activeSteerSystem");
	hideNoContentCommon(typeWay,"powerSunroof");
	hideNoContentCommon(typeWay,"panoramicSunroof");
	hideNoContentCommon(typeWay,"motionAppearSuite");
	hideNoContentCommon(typeWay,"elecSuctionDoor");
	hideNoContentCommon(typeWay,"leatherSw");
	hideNoContentCommon(typeWay,"swAdjust");
	hideNoContentCommon(typeWay,"swElecAdjust");
	hideNoContentCommon(typeWay,"multiFunSw");
	hideNoContentCommon(typeWay,"swShift");
	hideNoContentCommon(typeWay,"reverRadar");
	hideNoContentCommon(typeWay,"reverVideoImages");
	hideNoContentCommon(typeWay,"drivingScreen");
	hideNoContentCommon(typeWay,"hudDigisplay");
	hideNoContentCommon(typeWay,"gps");
	hideNoContentCommon(typeWay,"locInterServices");
	hideNoContentCommon(typeWay,"nvSystem");
	hideNoContentCommon(typeWay,"controlLcdDisplay");
	hideNoContentCommon(typeWay,"panoramicCamera");
	hideNoContentCommon(typeWay,"ccScreen");
	hideNoContentCommon(typeWay,"catTv");
	hideNoContentCommon(typeWay,"rearLcd");
	hideNoContentCommon(typeWay,"multimediaSystem");
	hideNoContentCommon(typeWay,"speakersNum");
	hideNoContentCommon(typeWay,"seatMateria");
	hideNoContentCommon(typeWay,"movementStyleSeats");
	hideNoContentCommon(typeWay,"seatHeightAdjust");
	hideNoContentCommon(typeWay,"lsAdjust");
	hideNoContentCommon(typeWay,"ssAdjust");
	hideNoContentCommon(typeWay,"driversElecAdjust");
	hideNoContentCommon(typeWay,"srAngleAdjust");
	hideNoContentCommon(typeWay,"srSeatMove");
	hideNoContentCommon(typeWay,"rsElecAdjust");
	hideNoContentCommon(typeWay,"elecChairMemory");
	hideNoContentCommon(typeWay,"frSeatHeating");
	hideNoContentCommon(typeWay,"rsVentilation");
	hideNoContentCommon(typeWay,"massageSeat");
	hideNoContentCommon(typeWay,"trSeats");
	hideNoContentCommon(typeWay,"rsWayDown");
	hideNoContentCommon(typeWay,"frCentralArmrest");
	hideNoContentCommon(typeWay,"rearCupHolder");
	hideNoContentCommon(typeWay,"bcPhone");
	hideNoContentCommon(typeWay,"extAudioInterface");
	hideNoContentCommon(typeWay,"audioSupportMp3");
	hideNoContentCommon(typeWay,"headlight");
	hideNoContentCommon(typeWay,"drLamps");
	hideNoContentCommon(typeWay,"autoHeadlights");
	hideNoContentCommon(typeWay,"shLamp");
	hideNoContentCommon(typeWay,"frontFogLamp");
	hideNoContentCommon(typeWay,"hhAdjust");
	hideNoContentCommon(typeWay,"hcDevice");
	hideNoContentCommon(typeWay,"atmoCarLights");
	hideNoContentCommon(typeWay,"frElecWins");
	hideNoContentCommon(typeWay,"winClipHandFun");
	hideNoContentCommon(typeWay,"heatProtectGlass");
	hideNoContentCommon(typeWay,"rmElecRegulation");
	hideNoContentCommon(typeWay,"rmHeating");
	hideNoContentCommon(typeWay,"rmAntiGlare");
	hideNoContentCommon(typeWay,"rmElecFolding");
	hideNoContentCommon(typeWay,"rmMemory");
	hideNoContentCommon(typeWay,"rearWs");
	hideNoContentCommon(typeWay,"rearsideWs");
	hideNoContentCommon(typeWay,"vcMirror");
	hideNoContentCommon(typeWay,"rearWiper");
	hideNoContentCommon(typeWay,"sensingWiper");
	hideNoContentCommon(typeWay,"acControlMode");
	hideNoContentCommon(typeWay,"rearIndeAc");
	hideNoContentCommon(typeWay,"rearDiffuser");
	hideNoContentCommon(typeWay,"tpZoneControl");
	hideNoContentCommon(typeWay,"carAirCondi");
	hideNoContentCommon(typeWay,"carRefrigerator");
}

//隐藏无内容项-common
function hideNoContentCommon(typeWay,columnName){
	if(typeWay=='hide'){	
		if((packageData[""+columnName+""]==undefined || packageData[""+columnName+""]=='') 
				&& (packagePkData[""+columnName+""]==undefined || packagePkData[""+columnName+""]=='')){
		    $("#"+columnName+"").parent().hide();
		}else{
			
			if(flag1==true){
				if(packageData[""+columnName+""]!=undefined && packageData[""+columnName+""]!=''
					&& packagePkData[""+columnName+""]!=undefined && packagePkData[""+columnName+""]!=''
						&& packageData[""+columnName+""]==packagePkData[""+columnName+""]){
				    $("#"+columnName+"").parent().hide();
				}else{
				    $("#"+columnName+"").parent().show();
				}
			}else{
			    $("#"+columnName+"").parent().show();
			}
		}
	}else if(typeWay=='show'){
	    $("#"+columnName+"").parent().show;
	}
}


//加载车型数据
function loadPackageData(packageCode,type){
	var suffix = '';
	if(type=='pk'){
		suffix='Pk';
	}
	$.ajax({
		method : 'get',
		url : rootPath+'/wechat/api/showroom/packages?packageCode='+packageCode,
		error:function(XMLHttpRequest, ajaxOptions, thrownError){
			alert("连接服务器错误!");
		},
		success : function(resultData){
			var lengthWidthHeight=''
				
			if(resultData.length!=undefined && resultData.length!=''){
				lengthWidthHeight += resultData.length +'*';
			}
			if(resultData.width!=undefined && resultData.width!=''){
				lengthWidthHeight += resultData.width +'*';
			}
			
			if(resultData.height!=undefined && resultData.height!=''){
				lengthWidthHeight += resultData.height;
			}

			if(type=='default'){
				packageData = resultData;
				packageData.lengthWidthHeight = lengthWidthHeight;

				
			}else if(type=='pk'){
				packagePkData = resultData;
				packagePkData.lengthWidthHeight = lengthWidthHeight;
			}
			
			
			$("#lengthWidthHeight"+suffix+"").text(lengthWidthHeight);

			$("#seriesImage"+suffix+"").attr("src",rootPath+'/images/'+resultData.brandName+'/外观/'+resultData.seriesName+'/'+resultData.seriesName+'.jpg');
			
			$("#packageCode"+suffix+"").val(resultData.packageCode);
			$("#packageName"+suffix+"").html(resultData.packageName);
			
			$("#vehicleModel"+suffix+"").text(packageValReplace(resultData.vehicleModel));
			$("#standardGear"+suffix+"").text(packageValReplace(resultData.standardGear));
			$("#engine"+suffix+"").text(packageValReplace(resultData.engine));
			$("#gearbox"+suffix+"").text(packageValReplace(resultData.gearbox));
			$("#bodyStructure"+suffix+"").text(packageValReplace(resultData.bodyStructure));
			$("#miitFuelConsum"+suffix+"").text(packageValReplace(resultData.miitFuelConsum));
			$("#length"+suffix+"").text(packageValReplace(resultData.length));
			$("#width"+suffix+"").text(packageValReplace(resultData.width));
			$("#height"+suffix+"").text(packageValReplace(resultData.height));
			$("#wheelBase"+suffix+"").text(packageValReplace(resultData.wheelBase));
			$("#fwTrack"+suffix+"").text(packageValReplace(resultData.fwTrack));
			$("#rwTrack"+suffix+"").text(packageValReplace(resultData.rwTrack));
			$("#curbWeight"+suffix+"").text(packageValReplace(resultData.curbWeight));
			$("#cargoVolume"+suffix+"").text(packageValReplace(resultData.cargoVolume));
			$("#engineModel"+suffix+"").text(packageValReplace(resultData.engineModel));
			$("#displacement"+suffix+"").text(packageValReplace(resultData.displacement));
			$("#cylinderVolume"+suffix+"").text(packageValReplace(resultData.cylinderVolume));
			$("#airIntakeForm"+suffix+"").text(packageValReplace(resultData.airIntakeForm));
			$("#cylinderArran"+suffix+"").text(packageValReplace(resultData.cylinderArran));
			$("#cylinderNum"+suffix+"").text(packageValReplace(resultData.cylinderNum));
			$("#cylinderNumPer"+suffix+"").text(packageValReplace(resultData.cylinderNumPer))
			$("#reductionRatio"+suffix+"").text(packageValReplace(resultData.reductionRatio));
			$("#maxHorsepower"+suffix+"").text(packageValReplace(resultData.maxHorsepower));
			$("#maxPower"+suffix+"").text(packageValReplace(resultData.maxPower));
			$("#maxPowerSpeed"+suffix+"").text(packageValReplace(resultData.maxPowerSpeed));
			$("#maxTorque"+suffix+"").text(packageValReplace(resultData.maxTorque));
			$("#maxTorqueSpeed"+suffix+"").text(packageValReplace(resultData.maxTorqueSpeed));
			$("#fuelType"+suffix+"").text(packageValReplace(resultData.fuelType));
			$("#fuelLabel"+suffix+"").text(packageValReplace(resultData.fuelLabel));
			$("#oilSupplyWay"+suffix+"").text(packageValReplace(resultData.oilSupplyWay));
			$("#fueltankVolume"+suffix+"").text(packageValReplace(resultData.fueltankVolume));
			$("#gearNum"+suffix+"").text(packageValReplace(resultData.gearNum));
			$("#gearboxType"+suffix+"").text(packageValReplace(resultData.gearboxType));
			$("#driveWay"+suffix+"").text(packageValReplace(resultData.driveWay));
			$("#frontSusType"+suffix+"").text(packageValReplace(resultData.frontSusType));
			$("#rearSusType"+suffix+"").text(packageValReplace(resultData.rearSusType));
			$("#powerType"+suffix+"").text(packageValReplace(resultData.powerType));
			$("#faType"+suffix+"").text(packageValReplace(resultData.faType))
			$("#raType"+suffix+"").text(packageValReplace(resultData.raType));
			$("#ftSize"+suffix+"").text(packageValReplace(resultData.ftSize));
			$("#rtSize"+suffix+"").text(packageValReplace(resultData.rtSize));
			$("#spareTireSize"+suffix+"").text(packageValReplace(resultData.spareTireSize));
			$("#wheelHubMaterial"+suffix+"").text(packageValReplace(resultData.wheelHubMaterial));
			$("#drivingAirbag"+suffix+"").text(packageValReplace(resultData.drivingAirbag));
			$("#copilotAirbag"+suffix+"").text(packageValReplace(resultData.copilotAirbag));
			$("#fsAirbag"+suffix+"").text(packageValReplace(resultData.fsAirbag));
			$("#fhAirbag"+suffix+"").text(packageValReplace(resultData.fhAirbag));
			$("#kneeAirbag"+suffix+"").text(packageValReplace(resultData.kneeAirbag));
			$("#rsAirbag"+suffix+"").text(packageValReplace(resultData.rsAirbag));
			$("#rhAirbag"+suffix+"").text(packageValReplace(resultData.rhAirbag));
			$("#saBeltPrompt"+suffix+"").text(packageValReplace(resultData.saBeltPrompt));
			$("#tirePmDevices"+suffix+"").text(packageValReplace(resultData.tirePmDevices));
			$("#zeroPressureLc"+suffix+"").text(packageValReplace(resultData.zeroPressureLc));
			$("#cenLock"+suffix+"").text(packageValReplace(resultData.cenLock));
			$("#csLock"+suffix+"").text(packageValReplace(resultData.csLock));
			$("#teleKey"+suffix+"").text(packageValReplace(resultData.teleKey));
			$("#keylessSs"+suffix+"").text(packageValReplace(resultData.keylessSs));
			$("#engineElecGuard"+suffix+"").text(packageValReplace(resultData.engineElecGuard));
			$("#absAntiLock"+suffix+"").text(packageValReplace(resultData.absAntiLock));
			$("#brakeForceDisb"+suffix+"").text(packageValReplace(resultData.brakeForceDisb));
			$("#brakeAssist"+suffix+"").text(packageValReplace(resultData.brakeAssist));
			$("#tractionControl"+suffix+"").text(packageValReplace(resultData.tractionControl));
			$("#stabilityControl"+suffix+"").text(packageValReplace(resultData.stabilityControl));
			$("#assistParking"+suffix+"").text(packageValReplace(resultData.assistParking));
			$("#slopeSlowDescent"+suffix+"").text(packageValReplace(resultData.slopeSlowDescent));
			$("#varSusp"+suffix+"").text(packageValReplace(resultData.varSusp));
			$("#airSusp"+suffix+"").text(packageValReplace(resultData.airSusp));
			$("#varSteerRatio"+suffix+"").text(packageValReplace(resultData.varSteerRatio));
			$("#autoPi"+suffix+"").text(packageValReplace(resultData.autoPi));
			$("#autoCruise"+suffix+"").text(packageValReplace(resultData.autoCruise));
			$("#cruiseControl"+suffix+"").text(packageValReplace(resultData.cruiseControl));
			$("#doublingAuxiliary"+suffix+"").text(packageValReplace(resultData.doublingAuxiliary));
			$("#initiativeBrake"+suffix+"").text(packageValReplace(resultData.initiativeBrake));
			$("#activeSteerSystem"+suffix+"").text(packageValReplace(resultData.activeSteerSystem));
			$("#powerSunroof"+suffix+"").text(packageValReplace(resultData.powerSunroof));
			$("#panoramicSunroof"+suffix+"").text(packageValReplace(resultData.panoramicSunroof));
			$("#motionAppearSuite"+suffix+"").text(packageValReplace(resultData.motionAppearSuite));
			$("#elecSuctionDoor"+suffix+"").text(packageValReplace(resultData.elecSuctionDoor));
			$("#leatherSw"+suffix+"").text(packageValReplace(resultData.leatherSw));
			$("#swAdjust"+suffix+"").text(packageValReplace(resultData.swAdjust));
			$("#swElecAdjust"+suffix+"").text(packageValReplace(resultData.swElecAdjust));
			$("#multiFunSw"+suffix+"").text(packageValReplace(resultData.multiFunSw));
			$("#swShift"+suffix+"").text(packageValReplace(resultData.swShift));
			$("#reverRadar"+suffix+"").text(packageValReplace(resultData.reverRadar));
			$("#reverVideoImages"+suffix+"").text(packageValReplace(resultData.reverVideoImages));
			$("#drivingScreen"+suffix+"").text(packageValReplace(resultData.drivingScreen));
			$("#hudDigisplay"+suffix+"").text(packageValReplace(resultData.hudDigisplay));
			$("#gps"+suffix+"").text(packageValReplace(resultData.gps));
			$("#locInterServices"+suffix+"").text(packageValReplace(resultData.locInterServices));
			$("#nvSystem"+suffix+"").text(packageValReplace(resultData.nvSystem));
			$("#controlLcdDisplay"+suffix+"").text(packageValReplace(resultData.controlLcdDisplay));
			$("#panoramicCamera"+suffix+"").text(packageValReplace(resultData.panoramicCamera));
			$("#ccScreen"+suffix+"").text(packageValReplace(resultData.ccScreen));
			$("#catTv"+suffix+"").text(packageValReplace(resultData.catTv));
			$("#rearLcd"+suffix+"").text(packageValReplace(resultData.rearLcd));
			$("#multimediaSystem"+suffix+"").text(packageValReplace(resultData.multimediaSystem));
			$("#speakersNum"+suffix+"").text(packageValReplace(resultData.speakersNum));
			$("#seatMateria"+suffix+"").text(packageValReplace(resultData.seatMateria));
			$("#movementStyleSeats"+suffix+"").text(packageValReplace(resultData.movementStyleSeats));
			$("#seatHeightAdjust"+suffix+"").text(packageValReplace(resultData.seatHeightAdjust));
			$("#lsAdjust"+suffix+"").text(packageValReplace(resultData.lsAdjust));
			$("#ssAdjust"+suffix+"").text(packageValReplace(resultData.ssAdjust));
			$("#driversElecAdjust"+suffix+"").text(packageValReplace(resultData.driversElecAdjust));
			$("#srAngleAdjust"+suffix+"").text(packageValReplace(resultData.srAngleAdjust));
			$("#srSeatMove"+suffix+"").text(packageValReplace(resultData.srSeatMove));
			$("#rsElecAdjust"+suffix+"").text(packageValReplace(resultData.rsElecAdjust));
			$("#elecChairMemory"+suffix+"").text(packageValReplace(resultData.elecChairMemory));
			$("#frSeatHeating"+suffix+"").text(packageValReplace(resultData.frSeatHeating));
			$("#rsVentilation"+suffix+"").text(packageValReplace(resultData.rsVentilation));
			$("#massageSeat"+suffix+"").text(packageValReplace(resultData.massageSeat));
			$("#trSeats"+suffix+"").text(packageValReplace(resultData.trSeats));
			$("#rsWayDown"+suffix+"").text(packageValReplace(resultData.rsWayDown));
			$("#frCentralArmrest"+suffix+"").text(packageValReplace(resultData.frCentralArmrest))
			$("#rearCupHolder"+suffix+"").text(packageValReplace(resultData.rearCupHolder));
			$("#bcPhone"+suffix+"").text(packageValReplace(resultData.bcPhone));
			$("#extAudioInterface"+suffix+"").text(packageValReplace(resultData.extAudioInterface))
			$("#audioSupportMp3"+suffix+"").text(packageValReplace(resultData.audioSupportMp3));
			$("#headlight"+suffix+"").text(packageValReplace(resultData.headlight));
			$("#drLamps"+suffix+"").text(packageValReplace(resultData.drLamps));
			$("#autoHeadlights"+suffix+"").text(packageValReplace(resultData.autoHeadlights));
			$("#shLamp"+suffix+"").text(packageValReplace(resultData.shLamp))
			$("#frontFogLamp"+suffix+"").text(packageValReplace(resultData.frontFogLamp));
			$("#hhAdjust"+suffix+"").text(packageValReplace(resultData.hhAdjust));
			$("#hcDevice"+suffix+"").text(packageValReplace(resultData.hcDevice));
			$("#atmoCarLights"+suffix+"").text(packageValReplace(resultData.atmoCarLights));
			$("#frElecWins"+suffix+"").text(packageValReplace(resultData.frElecWins));
			$("#winClipHandFun"+suffix+"").text(packageValReplace(resultData.winClipHandFun));
			$("#heatProtectGlass"+suffix+"").text(packageValReplace(resultData.heatProtectGlass));
			$("#rmElecRegulation"+suffix+"").text(packageValReplace(resultData.rmElecRegulation));
			$("#rmHeating"+suffix+"").text(packageValReplace(resultData.rmHeating));
			$("#rmAntiGlare"+suffix+"").text(packageValReplace(resultData.rmAntiGlare));
			$("#rmElecFolding"+suffix+"").text(packageValReplace(resultData.rmElecFolding));
			$("#rmMemory"+suffix+"").text(packageValReplace(resultData.rmMemory));
			$("#rearWs"+suffix+"").text(packageValReplace(resultData.rearWs));
			$("#rearsideWs"+suffix+"").text(packageValReplace(resultData.rearsideWs));
			$("#vcMirror"+suffix+"").text(packageValReplace(resultData.vcMirror));
			$("#rearWiper"+suffix+"").text(packageValReplace(resultData.rearWiper));
			$("#sensingWiper"+suffix+"").text(packageValReplace(resultData.sensingWiper));
			$("#acControlMode"+suffix+"").text(packageValReplace(resultData.acControlMode));
			$("#rearIndeAc"+suffix+"").text(packageValReplace(resultData.rearIndeAc));
			$("#rearDiffuser"+suffix+"").text(packageValReplace(resultData.rearDiffuser));
			$("#tpZoneControl"+suffix+"").text(packageValReplace(resultData.tpZoneControl));
			$("#carAirCondi"+suffix+"").text(packageValReplace(resultData.carAirCondi));
			$("#carRefrigerator"+suffix+"").text(packageValReplace(resultData.carRefrigerator));			
			
			
			 
		    $("#carModelExhibitionDiv").removeClass("active in");
			$("#carModelExhibitionDetailDiv").removeClass("active in");
		    $("#testDriveAppointmentForm").addClass("active in");
		    comparePackageInfo();
		}
	});
}


//初始化加载品牌车系界面 
function initBrandSeries(type){
	
	var brandCode = $("#defaultBrandCode").val();
	if(brandCode ==undefined || brandCode==''){
		brandCode='';
	}
	$("#carModelExhibitionDiv").empty();
	
	$.ajax({
		method : 'get',
		url : rootPath+'/wechat/api/showroom/brands?brandCode='+brandCode,
		error:function(XMLHttpRequest, ajaxOptions, thrownError){
			alert("连接服务器错误!");
		},
		success : function(resultData){
			var wholeHtml = '';
			var brandHtml = '';
			var seriesHtml = '';
			
			$.each(resultData,function(brandIndex,brandObj){
				brandHtml = '<h4>'+brandObj.brandName+'</h4>';
				brandHtml +='<ul class="list-group">';
				$.each(brandObj.series,function(seriesIndex,seriesObj){		
					seriesHtml = '<a onclick="selectModelPackage(this)" type='+type+' seriesCode="'+seriesObj.seriesCode+'" href="#" class="list-group-item">'+
								  '<span class="glyphicon glyphicon-chevron-right form-control-feedback"></span>'+
								  seriesObj.seriesName+
	                              '</a>';
					brandHtml +=seriesHtml;
				});
				
				brandHtml +='</ul>';
				
				wholeHtml +=brandHtml;
			});
			
	    	 $("#carModelExhibitionDiv").append(wholeHtml);
		     $("#testDriveAppointmentForm").removeClass("active in");
		     $("#carModelExhibitionDetailDiv").removeClass("active in");
		     $("#carModelExhibitionDiv").addClass("active in");
		     
		}
		
		
	});

}


//初始化加载车型配置页面
function initModelPackage(seriesCode,type){
	
	$("#carModelPackageExhibitionDiv").empty();
	$.ajax({
		method : 'get',
		url : rootPath+'/wechat/api/showroom/series?seriesCode='+seriesCode,
		error:function(XMLHttpRequest, ajaxOptions, thrownError){
			alert("连接服务器错误!");
		},
		success : function(resultData){
			var wholeHtml = '';
			$.each(resultData.models,function(modelIndex,modelObj){
				
				var modelHtml =  '<ul class="list-group">'
							+'    <a href="#" class="list-group-item active">'
							+         modelObj.modelName
					        +'    </a>';
				
				$.each(modelObj.packages,function(packageIndex,packageObj){
					var packageHtml = '<a href="#" onclick="selectConcretePackage(this)" type='+type+' modelCode='+modelObj.modelCode+' packageCode='+packageObj.packageCode+' packageName='+packageObj.packageName+' class="list-group-item">'
							  	 +'  <span class="glyphicon glyphicon glyphicon-heart form-control-feedback"></span>'
							  	 +       packageObj.packageName
					             +'</a>';
					
					 
					modelHtml +=packageHtml;
					
				});
				
				modelHtml +='</ul>';
				
				wholeHtml +=modelHtml;
				
			});
			
			 $("#carModelPackageExhibitionDiv").append(wholeHtml);
		     $("#testDriveAppointmentForm").removeClass("active in");
		     $("#carModelExhibitionDiv").removeClass("active in");
			 $("#carModelExhibitionDetailDiv").addClass("active in");
			
		}
	});

}


//选择车型配置页面
function selectModelPackage(obj){
	 var seriesCode = $(obj).attr("seriesCode");
	 var type = $(obj).attr("type");
	 
	 $("#defaultSeriesCode").val(seriesCode);
	 initModelPackage(seriesCode,type);
}


//选择具体的车型配置
function selectConcretePackage(obj){
//	 var modelCode = $(obj).attr("modelCode");
	 var packageCode = $(obj).attr("packageCode");
//	 var packageName = $(obj).attr("packageName");
	 var type = $(obj).attr("type");
	 
//	 var packageName = $(obj).text();
//	 
//	 $("#packageName").html(packageName);
//	 
//	 $("#defaultModelCode").val(modelCode);
//	 $("#defaultPackageCode").val(packageCode);
	 
    
	loadPackageData(packageCode,type);

}



//窗口居中计算
function windowSizeChange_packageExhiPk(){
	var h1 = $("#containerHead").height();
	
	$("#containerHeadVech").css("margin-top",(h1)/2);
}